#pragma once

#include <map>
#include <vector>

struct Complex;

/*
AmplitudeIndex and SortedAmplitudes are utility classes, used to sort FFT'd data by amplitude
*/
class AmplitudeIndex
{
public:
	AmplitudeIndex(double amplitude, unsigned int index);
	~AmplitudeIndex(void);

	double amplitude;
	unsigned int index;
};

typedef std::map<double, std::vector<AmplitudeIndex>* > SortedAmplitudeMap;

class SortedAmplitudes
{
public:
	/*
	Constructor that creates a map of fft indices sorted by their amplitudes
	*/
	SortedAmplitudes(Complex* complex, unsigned int length);
	~SortedAmplitudes();

	/*
	Returns the map of fft indices sorted by amplitude
	*/
	SortedAmplitudeMap* GetSortedAmplitudeMap();

	/*
	Populates 'destination' with the amplitude/index of the 'count' highest amplitudes.
	*/
	void GetHighestAmplitudes(unsigned int count, std::vector<AmplitudeIndex>& destination);

private:
	 SortedAmplitudeMap map;
};